package com.zzxy.spring5.aspect;

import org.aopalliance.intercept.Joinpoint;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

public class MyAspectAop implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        System.out.println("before ..");
        Object obj=methodInvocation.proceed();
        System.out.println("after ..");
        return obj;
    }

    public void myBefore(JoinPoint joinPoint) throws Throwable {
    }

    public void myAfterReturing(JoinPoint joinPoint) throws Throwable {
    }

    public void myThrowing(JoinPoint joinPoint) throws Throwable {
    }

    public void myAfter(JoinPoint joinPoint) throws Throwable {
    }

    public Object myAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        Joinpoint pjp = null;
        return pjp .proceed();
    }
}
